package com.societyGames.codeAlong.state.codeExercise.model.help
{
	import com.societyGames.codeAlong.state.codeExercise.model.Exception;
	import com.societyGames.system.IXmlInitialize;

	public class IdExceptionHelp implements IExceptionHelp, IXmlInitialize
	{
		private var _errorId:int;
		private var _help:String;

		//IXmlInitialize-->
		public function initializeWithXml(xml:XML):void
		{
			this._errorId = int(xml.id[0].toString());
			this._help = xml.help[0].toString();
		}
		//<--IXmlInitialize

		//IExceptionHelp-->
		public function getHelp(exception:Exception):String //Returns hyper text help.
		{
			if (this._errorId == exception.error.errorID)
			{
				return this._help;
			}
			return null;
		}
		//<--IExceptionHelp
	}
}